package com.tsd.core.annotation;


import com.tsd.core.utils.LockUtil;

import java.lang.annotation.*;

/**
 * @ClassName: RepeatSubmit
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2023/8/4 16:21
 * @Version: 1.0
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {

    enum Type {MOBILE, PARAM}

    /**
     * 默认防重提交，是方法参数
     *
     * @return
     */
    Type limitType() default Type.PARAM;

    String mobileKey() default "mobile";

    /**
     * 加锁过期时间，默认是1分钟
     *
     * @return
     */
    long lockTime() default LockUtil.SUBMIT_INTERVAL;
}
